home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume14 / jove4.9 / part01 next >
Encoding:
Internet Message Format  |  1988-04-25  |  62.6 KB

  1. Subject:  v14i057:  Jove, an emacs variant, version 4.9, Part01/21
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Jonathan Payne <jpayne@cs.rochester.edu>
  7. Posting-number: Volume 14, Issue 57
  8. Archive-name: jove4.9/part01
  9.  
  10. [  JOVE is full-screen text editor that resembles Emacs in many ways
  11.    (the introductory documentation is a revised form of the Stallman's
  12.    Emacs tutorial).  JOVE provides sub-processes, crash recovery,
  13.    macros, and so on.  Not all features may be available on all systems,
  14.    but I believe a sub-shell with pipes is available for sites without
  15.    BSD-style networking.  The major new feature of this release is
  16.    that Jove now works on MS-DOS and the Macintosh; this is a big win
  17.    for people who have to use a number of different machines.  For more
  18.    details, see all the README files and the very extensive
  19.    documentation.  --r$  ]
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of archive 1 (of 21)."
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f './MANIFEST' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'./MANIFEST'\"
  31. else
  32. echo shar: Extracting \"'./MANIFEST'\" \(2625 characters\)
  33. sed "s/^X//" >'./MANIFEST' <<'END_OF_FILE'
  34. X   File Name        Archive #    Description
  35. X-----------------------------------------------------------
  36. X ./MANIFEST                 1    
  37. X ./Makefile                 4    
  38. X ./Makefile.dos             1    
  39. X ./Ovmakefile               3    
  40. X ./README                   4    
  41. X ./Readme.dos               5    
  42. X ./Readme.mac               8    
  43. X ./abbrev.c                 3    
  44. X ./argcount.c               1    
  45. X ./ask.c                    6    
  46. X ./buf.c                    6    
  47. X ./c.c                      7    
  48. X ./case.c                   1    
  49. X ./ctype.c                  5    
  50. X ./ctype.h                  1    
  51. X ./delete.c                 3    
  52. X ./disp.c                  13    
  53. X ./doc/README               1    
  54. X ./doc/cmds.doc.nr          1    
  55. X ./doc/example.rc           1    
  56. X ./doc/jove.1              19    
  57. X ./doc/jove.2              17    
  58. X ./doc/jove.3               6    
  59. X ./doc/jove.4              20    
  60. X ./doc/jove.5              16    
  61. X ./doc/jove.nr              5    
  62. X ./doc/jove.qref            2    
  63. X ./doc/system.rc            1    
  64. X ./doc/teach-jove          18    
  65. X ./doc/teachjove.nr         1    
  66. X ./extend.c                10    
  67. X ./externs.h               11    
  68. X ./fmt.c                    4    
  69. X ./fp.c                     3    
  70. X ./funcdefs.c               9    
  71. X ./getch.c                  1    
  72. X ./insert.c                 7    
  73. X ./io.c                    12    
  74. X ./io.h                     1    
  75. X ./iproc-pipes.c            3    
  76. X ./iproc-ptys.c             3    
  77. X ./iproc.c                  4    
  78. X ./jove.c                  11    
  79. X ./jove.h                   8    
  80. X ./keymaps.txt             15    
  81. X ./mac.c                   21    
  82. X ./mac.h                    2    
  83. X ./macros.c                 3    
  84. X ./macvert.c                1    
  85. X ./malloc.c                 2    
  86. X ./marks.c                  2    
  87. X ./menumaps.txt             1    
  88. X ./misc.c                   4    
  89. X ./mjovers.Hqx              1    
  90. X ./move.c                   2    
  91. X ./paragraph.c              6    
  92. X ./portsrv.c                1    
  93. X ./proc.c                   9    
  94. X ./re.c                    10    
  95. X ./re.h                     1    
  96. X ./re1.c                    5    
  97. X ./rec.c                    1    
  98. X ./rec.h                    1    
  99. X ./recover.c                7    
  100. X ./scandir.c                2    
  101. X ./screen.c                14    
  102. X ./setmaps.c                2    
  103. X ./table.c                  1    
  104. X ./table.h                  1    
  105. X ./teachjove.c              1    
  106. X ./temp.h                   1    
  107. X ./term.c                   2    
  108. X ./termcap.h                1    
  109. X ./tune.dos                 1    
  110. X ./tune.h                   2    
  111. X ./tune.template            1    
  112. X ./util.c                   8    
  113. X ./vars.c                   2    
  114. X ./version.c                1    
  115. X ./wind.c                   4    
  116. X MANIFEST                   1    This shipping list
  117. END_OF_FILE
  118. if test 2625 -ne `wc -c <'./MANIFEST'`; then
  119.     echo shar: \"'./MANIFEST'\" unpacked with wrong size!
  120. fi
  121. # end of './MANIFEST'
  122. fi
  123. if test -f './Makefile.dos' -a "${1}" != "-c" ; then 
  124.   echo shar: Will not clobber existing file \"'./Makefile.dos'\"
  125. else
  126. echo shar: Extracting \"'./Makefile.dos'\" \(1886 characters\)
  127. sed "s/^X//" >'./Makefile.dos' <<'END_OF_FILE'
  128. X###########################################################################
  129. X# This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE #
  130. X# is provided to you without charge, and with no warranty.  You may give  #
  131. X# away copies of JOVE, including sources, provided that this notice is    #
  132. X# included in all the files.                                              #
  133. X###########################################################################
  134. X
  135. MEM = L              # M for medium or L for large
  136. DEB = -Gs -Ot        # use -Zi and MEM = M for debugging
  137. X#
  138. X# define LINT_ARGS to use function prototypes
  139. X#
  140. CFLAGS = -A$(MEM) -J -Zp $(DEB) -DIBMPC
  141. LIB = C:\C\LIB
  142. X#
  143. X# linker flags: for debugging use /NOE/NOI/F/B/PAC/CO/STACK:0x2000
  144. X#
  145. LDFLAGS = /NOE/NOI/MAP/F/B/E/PAC/STACK:0x2000
  146. X#
  147. X# set VPATH as below if you have sources in SRC
  148. X#
  149. SRC = .
  150. X# VPATH = .;..    # should read .;$(SRC) - but doesn't work
  151. X
  152. OBJECTS = keymaps.obj funcdefs.obj abbrev.obj ask.obj buf.obj c.obj \
  153. X    case.obj ctype.obj delete.obj extend.obj argcount.obj \
  154. X    insert.obj io.obj jove.obj macros.obj marks.obj misc.obj move.obj \
  155. X    paragrap.obj proc.obj re.obj re1.obj scandir.obj \
  156. X    table.obj tune.obj util.obj vars.obj wind.obj \
  157. X    fmt.obj disp.obj term.obj version.obj fp.obj screen.obj getch.obj
  158. X
  159. HEADERS = ctype.h io.h jove.h re.h table.h temp.h termcap.h tune.h externs.h
  160. X
  161. jove.exe:    $(OBJECTS) $(HEADERS)
  162. X    link $(OBJECTS) $(LIB)\setargv,jove $(LDFLAGS);
  163. X
  164. X$(OBJECTS): $(HEADERS)
  165. X
  166. setmaps.exe:    setmaps.obj funcdefs.c
  167. X    cl setmaps.obj
  168. X
  169. setmaps.obj:    funcdefs.c keymaps.txt
  170. X    cl $(CFLAGS) $(SRC)\setmaps.c
  171. X
  172. keymaps.c:    setmaps.exe keymaps.txt
  173. X    setmaps < keymaps.txt > keymaps.c
  174. X
  175. keymaps.obj:    keymaps.c jove.h
  176. X    $(CC) $(CFLAGS) -I$(SRC) -c keymaps.c
  177. X
  178. X# to avoid accidental loss under unix
  179. tune.c:    tune.dos
  180. X    copy tune.dos tune.c
  181. X
  182. tune.obj: tune.c
  183. X    $(CC) $(CFLAGS) -I$(SRC) -c tune.c
  184. X
  185. clean:
  186. X    -rm *.obj setmaps.exe keymaps.c *.bak *.map
  187. X
  188. END_OF_FILE
  189. if test 1886 -ne `wc -c <'./Makefile.dos'`; then
  190.     echo shar: \"'./Makefile.dos'\" unpacked with wrong size!
  191. fi
  192. # end of './Makefile.dos'
  193. fi
  194. if test -f './argcount.c' -a "${1}" != "-c" ; then 
  195.   echo shar: Will not clobber existing file \"'./argcount.c'\"
  196. else
  197. echo shar: Extracting \"'./argcount.c'\" \(3763 characters\)
  198. sed "s/^X//" >'./argcount.c' <<'END_OF_FILE'
  199. X/***************************************************************************
  200. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  201. X * is provided to you without charge, and with no warranty.  You may give  *
  202. X * away copies of JOVE, including sources, provided that this notice is    *
  203. X * included in all the files.                                              *
  204. X ***************************************************************************/
  205. X
  206. X#include "jove.h"
  207. X#include <ctype.h>
  208. X
  209. X#ifdef MAC
  210. X#    undef private
  211. X#    define private
  212. X#endif
  213. X
  214. X#ifdef    LINT_ARGS
  215. private    void
  216. X    gather_numeric_argument(int),
  217. X    quad_numeric_arg(void);
  218. X#else
  219. private    void
  220. X    gather_numeric_argument(),
  221. X    quad_numeric_arg();
  222. X#endif
  223. X
  224. X#ifdef MAC
  225. X#    undef private
  226. X#    define private static
  227. X#endif
  228. X
  229. private int    arg_supplied_p,
  230. X        arg_count;
  231. X
  232. int
  233. arg_type()
  234. X{
  235. X    return arg_supplied_p;
  236. X}
  237. X
  238. void
  239. set_is_an_arg(there_is)
  240. X{
  241. X    arg_supplied_p = there_is;
  242. X}
  243. X
  244. void
  245. set_arg_value(n)
  246. X{
  247. X    arg_supplied_p = YES;
  248. X    arg_count = n;
  249. X}
  250. X
  251. void
  252. negate_arg_value()
  253. X{
  254. X    arg_count = -arg_count;
  255. X}
  256. X
  257. void
  258. clr_arg_value()
  259. X{
  260. X    arg_supplied_p = NO;
  261. X    arg_count = 1;
  262. X}
  263. X
  264. X/* return whether there is currently a numeric argument */
  265. X
  266. int
  267. is_an_arg()
  268. X{
  269. X    return (arg_supplied_p != NO);
  270. X}
  271. X
  272. X/* return the numeric argument */
  273. X
  274. int
  275. arg_value()
  276. X{
  277. X    return arg_count;
  278. X}
  279. X
  280. X/* called by C-U to gather a numeric argument, either C-U's or digits,
  281. X   but not both */
  282. X
  283. void
  284. TimesFour()
  285. X{
  286. X    quad_numeric_arg();
  287. X}
  288. X
  289. X/* This initializes the numeric argument to 1 and starts multiplying
  290. X   by 4 (the magic number Stallman came up with).  It is an error to
  291. X   invoke quad_numeric_arg() interactively (via TimesFour()), because
  292. X   it uses the LastKeyStruck variable to know what character signals
  293. X   to multiply again (in the loop). */
  294. private void
  295. quad_numeric_arg()
  296. X{
  297. X    int    oldc = LastKeyStruck,
  298. X        newc,
  299. X        narg_count,
  300. X        slow;
  301. X
  302. X    slow = 0;
  303. X    arg_supplied_p = YES;
  304. X    arg_count = 1;
  305. X    this_cmd = ARG_CMD;
  306. X    do {
  307. X        if ((narg_count = arg_count * 4) != 0)
  308. X            arg_count = narg_count;
  309. X        if (!slow)
  310. X            newc = waitchar(&slow);
  311. X        else
  312. X            newc = getch();
  313. X        if (isdigit(newc) || newc == '-') {
  314. X             arg_supplied_p = NO;
  315. X             gather_numeric_argument(newc);
  316. X             return;
  317. X        }
  318. X        if (slow)
  319. X            message(key_strokes);
  320. X    } while (newc == oldc);
  321. X    Ungetc(newc);
  322. X}
  323. X
  324. private void
  325. gather_numeric_argument(c)
  326. X{
  327. X    int    sign = 0;
  328. X    static int    digited;
  329. X    int    slow = 0;
  330. X
  331. X    if (!isdigit(c) && c != '-')
  332. X        complain((char *) 0);
  333. X    if (arg_supplied_p == NO) {    /* if we just got here */
  334. X        arg_count = 0;    /* start over */
  335. X        digited = NO;
  336. X    } else if (arg_supplied_p == YES_NODIGIT) {
  337. X        sign = (arg_count < 0) ? -1 : 1;
  338. X        arg_count = 0;
  339. X    }
  340. X
  341. X    if (!sign)
  342. X        sign = (arg_count < 0) ? -1 : 1;
  343. X    if (sign == -1)
  344. X        arg_count = -arg_count;
  345. X    if (c == '-') {
  346. X        sign = -sign;
  347. X        goto goread;
  348. X    }
  349. X    for (;;) {
  350. X        if (slow)
  351. X            message(key_strokes);
  352. X        if (isdigit(c)) {
  353. X            arg_count = (arg_count * 10) + (c - '0');
  354. X            digited = YES;
  355. X        } else {
  356. X            if (digited)
  357. X                arg_supplied_p = YES;
  358. X            else {
  359. X                arg_count = 1;
  360. X                if (arg_supplied_p == NO)
  361. X                    arg_supplied_p = YES_NODIGIT;
  362. X            }
  363. X            arg_count *= sign;
  364. X            this_cmd = ARG_CMD;
  365. X            Ungetc(c);
  366. X            return;
  367. X        }
  368. goread:        if (!slow)
  369. X            c = waitchar(&slow);
  370. X        else {
  371. X            add_mess(NullStr);
  372. X            c = getch();
  373. X        }
  374. X    }
  375. X}
  376. X
  377. void
  378. Digit()
  379. X{
  380. X    gather_numeric_argument(LastKeyStruck);
  381. X}
  382. X
  383. void
  384. Digit0()
  385. X{
  386. X    gather_numeric_argument('0');
  387. X}
  388. X
  389. void
  390. Digit1()
  391. X{
  392. X    gather_numeric_argument('1');
  393. X}
  394. X
  395. void
  396. Digit2()
  397. X{
  398. X    gather_numeric_argument('2');
  399. X}
  400. X
  401. void
  402. Digit3()
  403. X{
  404. X    gather_numeric_argument('3');
  405. X}
  406. X
  407. void
  408. Digit4()
  409. X{
  410. X    gather_numeric_argument('4');
  411. X}
  412. X
  413. void
  414. Digit5()
  415. X{
  416. X    gather_numeric_argument('5');
  417. X}
  418. X
  419. void
  420. Digit6()
  421. X{
  422. X    gather_numeric_argument('6');
  423. X}
  424. X
  425. void
  426. Digit7()
  427. X{
  428. X    gather_numeric_argument('7');
  429. X}
  430. X
  431. void
  432. Digit8()
  433. X{
  434. X    gather_numeric_argument('8');
  435. X}
  436. X
  437. void
  438. Digit9()
  439. X{
  440. X    gather_numeric_argument('9');
  441. X}
  442. END_OF_FILE
  443. if test 3763 -ne `wc -c <'./argcount.c'`; then
  444.     echo shar: \"'./argcount.c'\" unpacked with wrong size!
  445. fi
  446. # end of './argcount.c'
  447. fi
  448. if test -f './case.c' -a "${1}" != "-c" ; then 
  449.   echo shar: Will not clobber existing file \"'./case.c'\"
  450. else
  451. echo shar: Extracting \"'./case.c'\" \(3737 characters\)
  452. sed "s/^X//" >'./case.c' <<'END_OF_FILE'
  453. X/***************************************************************************
  454. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  455. X * is provided to you without charge, and with no warranty.  You may give  *
  456. X * away copies of JOVE, including sources, provided that this notice is    *
  457. X * included in all the files.                                              *
  458. X ***************************************************************************/
  459. X
  460. X#include "jove.h"
  461. X#include "ctype.h"
  462. X
  463. X#ifdef MAC
  464. X#    undef private
  465. X#    define private
  466. X#endif
  467. X
  468. X#ifdef    LINT_ARGS
  469. private    int
  470. X#if !(defined(IBMPC) || defined(MAC))
  471. X    lower(char *),
  472. X#endif
  473. X    upper(char *);
  474. X#else
  475. private    int
  476. X#if !(defined(IBMPC) || defined(MAC))
  477. X    lower(),
  478. X#endif
  479. X    upper();
  480. X#endif    /* LINT_ARGS */
  481. X
  482. X#ifdef MAC
  483. X#    undef private
  484. X#    define private static
  485. X#endif
  486. X
  487. void
  488. CapChar()
  489. X{
  490. X    register int    num,
  491. X            restore = NO;
  492. X    Bufpos    b;
  493. X
  494. X    DOTsave(&b);
  495. X
  496. X    num = arg_value();
  497. X    if (num < 0) {
  498. X        restore = YES;
  499. X        num = -num;
  500. X        b_char(num);    /* Cap previous EXP chars */
  501. X    }
  502. X    while (num--) {
  503. X        if (upper(&linebuf[curchar])) {
  504. X            modify();
  505. X            makedirty(curline);
  506. X        }
  507. X        if (eolp()) {
  508. X            if (curline->l_next == 0)
  509. X                break;
  510. X            SetLine(curline->l_next);
  511. X        } else
  512. X            curchar += 1;
  513. X    }
  514. X    if (restore)
  515. X        SetDot(&b);
  516. X}
  517. X
  518. void
  519. CapWord()
  520. X{
  521. X    register int    num,
  522. X            restore = NO;
  523. X    Bufpos    b;
  524. X
  525. X    DOTsave(&b);
  526. X    num = arg_value();
  527. X    if (num < 0) {
  528. X        restore = YES;
  529. X        num = -num;
  530. X        b_word(num);        /* Cap previous EXP words */
  531. X    }
  532. X    while (num--) {
  533. X        to_word(1);    /* Go to the beginning of the next word. */
  534. X        if (eobp())
  535. X            break;
  536. X        if (upper(&linebuf[curchar])) {
  537. X            modify();
  538. X            makedirty(curline);
  539. X        }
  540. X        curchar += 1;
  541. X        while (!eolp() && isword(linebuf[curchar])) {
  542. X            if (lower(&linebuf[curchar])) {
  543. X                modify();
  544. X                makedirty(curline);
  545. X            }
  546. X            curchar += 1;
  547. X        }
  548. X    }
  549. X    if (restore)
  550. X        SetDot(&b);
  551. X}
  552. X
  553. void
  554. case_word(up)
  555. X{
  556. X    Bufpos    before;
  557. X
  558. X    DOTsave(&before);
  559. X    ForWord();    /* this'll go backward if negative argument */
  560. X    case_reg(before.p_line, before.p_char, curline, curchar, up);
  561. X}
  562. X
  563. private int
  564. upper(c)
  565. register char    *c;
  566. X{
  567. X    if (islower(*c)) {
  568. X#ifndef ASCII            /* check for IBM extended character set */
  569. X        if (*c <= 127)
  570. X#endif /* ASCII */
  571. X        *c -= ' ';
  572. X#ifdef IBMPC            /* ... and change Umlaute    */
  573. X        else 
  574. X           switch (*c) {
  575. X             case 129: *c = 154; break;        /* ue */
  576. X             case 132: *c = 142; break;        /* ae */
  577. X             case 148: *c = 153; break;        /* oe */
  578. X           }
  579. X#endif /* IBMPC */
  580. X#ifdef MAC
  581. X        else *c = CaseEquiv[*c];
  582. X#endif
  583. X        return 1;
  584. X    }
  585. X    return 0;
  586. X}
  587. X
  588. X#if !(defined(IBMPC) || defined(MAC))
  589. private
  590. X#endif
  591. int
  592. lower(c)
  593. char    *c;
  594. X{
  595. X    if (isupper(*c)) {
  596. X#ifndef ASCII
  597. X        if (*c <= 127) 
  598. X#endif /* ASCII */
  599. X        *c += ' ';
  600. X#ifdef IBMPC
  601. X        else
  602. X              switch (*c) {
  603. X             case 142: *c = 132; break;        /* Ae */
  604. X             case 153: *c = 148; break;        /* Oe */
  605. X             case 154: *c = 129; break;        /* Ue */
  606. X           }
  607. X#endif /* IBMPC */
  608. X#ifdef MAC
  609. X        else {
  610. X            int n;
  611. X            
  612. X            for(n = 128; n < 256; n++) {
  613. X                if((CaseEquiv[n] == *c) && islower(n)) {
  614. X                    *c = n;
  615. X                    break;
  616. X                }
  617. X            }
  618. X            if(n > 255) return(0);
  619. X        }
  620. X#endif /* MAC */        
  621. X        return 1;
  622. X    }
  623. X    return 0;
  624. X}
  625. X
  626. void
  627. case_reg(line1, char1, line2, char2, up)
  628. Line    *line1,
  629. X    *line2;
  630. int    char1;
  631. X{
  632. X    (void) fixorder(&line1, &char1, &line2, &char2);
  633. X    DotTo(line1, char1);
  634. X
  635. X    for (;;) {
  636. X        if (curline == line2 && curchar == char2)
  637. X            break;
  638. X        if (!eolp())
  639. X            if ((up) ? upper(&linebuf[curchar]) : lower(&linebuf[curchar])) {
  640. X                makedirty(curline);
  641. X                modify();
  642. X            }
  643. X        f_char(1);
  644. X    }
  645. X}
  646. X
  647. void
  648. CasRegLower()
  649. X{
  650. X    CaseReg(0);
  651. X}
  652. X
  653. void
  654. CasRegUpper()
  655. X{
  656. X    CaseReg(1);
  657. X}
  658. X
  659. void
  660. CaseReg(up)
  661. X{
  662. X    register Mark    *mp = CurMark();
  663. X    Bufpos    savedot;
  664. X
  665. X    DOTsave(&savedot);
  666. X    case_reg(curline, curchar, mp->m_line, mp->m_char, up);
  667. X    SetDot(&savedot);
  668. X}
  669. X
  670. void
  671. UppWord()
  672. X{
  673. X    case_word(1);
  674. X}
  675. X
  676. void
  677. LowWord()
  678. X{
  679. X    case_word(0);
  680. X}
  681. END_OF_FILE
  682. if test 3737 -ne `wc -c <'./case.c'`; then
  683.     echo shar: \"'./case.c'\" unpacked with wrong size!
  684. fi
  685. # end of './case.c'
  686. fi
  687. if test -f './ctype.h' -a "${1}" != "-c" ; then 
  688.   echo shar: Will not clobber existing file \"'./ctype.h'\"
  689. else
  690. echo shar: Extracting \"'./ctype.h'\" \(1644 characters\)
  691. sed "s/^X//" >'./ctype.h' <<'END_OF_FILE'
  692. X/***************************************************************************
  693. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  694. X * is provided to you without charge, and with no warranty.  You may give  *
  695. X * away copies of JOVE, including sources, provided that this notice is    *
  696. X * included in all the files.                                              *
  697. X ***************************************************************************/
  698. X
  699. X/* The code in this file was snarfed from ctype.h and modified for JOVE. */
  700. X
  701. X#define    _U    01
  702. X#define    _L    02
  703. X#define    _N    04
  704. X#define _P    010
  705. X#define _C    020
  706. X#define _W    040
  707. X#define _Op    0100
  708. X#define _Cl    0200
  709. X
  710. extern int    SyntaxTable;
  711. X#define iswhite(c)    (isspace(c))
  712. X#define isword(c)    ((CharTable[SyntaxTable])[c]&(_W))
  713. X#define    isalpha(c)    ((CharTable[SyntaxTable])[c]&(_U|_L))
  714. X#define    isupper(c)    ((CharTable[SyntaxTable])[c]&_U)
  715. X#define    islower(c)    ((CharTable[SyntaxTable])[c]&_L)
  716. X#define    isdigit(c)    ((CharTable[SyntaxTable])[c]&_N)
  717. X#define    isspace(c)    (c == ' ' || c == '\t')
  718. X#define ispunct(c)    ((CharTable[SyntaxTable])[c]&_P)
  719. X
  720. X
  721. X#define toascii(c)    ((c)&CHARMASK)
  722. X#define isctrl(c)    ((CharTable[0][c&CHARMASK])&_C)
  723. X#define isopenp(c)    ((CharTable[0][c&CHARMASK])&_Op)
  724. X#define isclosep(c)    ((CharTable[0][c&CHARMASK])&_Cl)
  725. X#define has_syntax(c,s)    ((CharTable[SyntaxTable][c&CHARMASK])&s)
  726. X
  727. X#ifdef ASCII
  728. X#define toupper(c)    ((c)&~040)
  729. X#define tolower(c)    ((c)|040)
  730. X#else /* IBMPC or MAC */
  731. X#define toupper(c)    (CaseEquiv[c])
  732. X/* #define tolower(c)    ((c)|040)    */
  733. X#endif /* IBMPC */
  734. X
  735. X#define WITH_TABLE(x) \
  736. X{ \
  737. X    int    push = SyntaxTable; \
  738. X    SyntaxTable = x;
  739. X
  740. X#define END_TABLE() \
  741. X    SyntaxTable = push; \
  742. X}
  743. END_OF_FILE
  744. if test 1644 -ne `wc -c <'./ctype.h'`; then
  745.     echo shar: \"'./ctype.h'\" unpacked with wrong size!
  746. fi
  747. # end of './ctype.h'
  748. fi
  749. if test -f './doc/README' -a "${1}" != "-c" ; then 
  750.   echo shar: Will not clobber existing file \"'./doc/README'\"
  751. else
  752. echo shar: Extracting \"'./doc/README'\" \(306 characters\)
  753. sed "s/^X//" >'./doc/README' <<'END_OF_FILE'
  754. To create the jove manual (as opposed to the man pages)
  755. just do "nroff -ms jove.[12345]" (or ditroff or troff).
  756. That should do the trick.  The man pages will be installed
  757. automatically by "make install" in the previous directory.
  758. And the online/run-time documentation will be installed
  759. automatically, too.
  760. END_OF_FILE
  761. if test 306 -ne `wc -c <'./doc/README'`; then
  762.     echo shar: \"'./doc/README'\" unpacked with wrong size!
  763. fi
  764. # end of './doc/README'
  765. fi
  766. if test -f './doc/cmds.doc.nr' -a "${1}" != "-c" ; then 
  767.   echo shar: Will not clobber existing file \"'./doc/cmds.doc.nr'\"
  768. else
  769. echo shar: Extracting \"'./doc/cmds.doc.nr'\" \(238 characters\)
  770. sed "s/^X//" >'./doc/cmds.doc.nr' <<'END_OF_FILE'
  771. X.de bp
  772. X..
  773. X.de NH
  774. X..
  775. X.de IQ
  776. X"\\$1"
  777. X..
  778. X.de dc
  779. X.sp 1
  780. X:entry "\\$1"
  781. X.if '\\$2'(variable)' "Variable"
  782. X.if !'\\$2'(variable)' "Command"
  783. X.br
  784. X..
  785. X.de ID
  786. X.sp 1
  787. X.in +5
  788. X..
  789. X.de DE
  790. X.fi
  791. X.sp 1
  792. X.in -5
  793. X..
  794. X.de DS
  795. X.nf
  796. X.sp 1
  797. X.in +5
  798. X..
  799. X.de UX
  800. UNIX\c
  801. X..
  802. X.ll 7i
  803. END_OF_FILE
  804. if test 238 -ne `wc -c <'./doc/cmds.doc.nr'`; then
  805.     echo shar: \"'./doc/cmds.doc.nr'\" unpacked with wrong size!
  806. fi
  807. # end of './doc/cmds.doc.nr'
  808. fi
  809. if test -f './doc/example.rc' -a "${1}" != "-c" ; then 
  810.   echo shar: Will not clobber existing file \"'./doc/example.rc'\"
  811. else
  812. echo shar: Extracting \"'./doc/example.rc'\" \(715 characters\)
  813. sed "s/^X//" >'./doc/example.rc' <<'END_OF_FILE'
  814. if /ua/jonathan/src/jove/lib/isttytype iq120
  815. X    bind-to-key Prefix-1 \\
  816. X    bind-to-key set-mark ^[ 
  817. X    set allow-^S-and-^Q on
  818. endif
  819. if /ua/jonathan/src/jove/lib/modemp
  820. X    set mode-line  -%n %m "%f" %((%t%s%C%s%l)%)
  821. else
  822. X    set mode-line  -%n- %["%f" %m [%b] %]%s%((%t%s%C%s%l)%)%s(%M) %e
  823. endif
  824. auto-execute-command show-match .*\.[ch]$
  825. set comment-format /* %!   %c%! */
  826. set disable-biff on
  827. set match-regular-expressions on
  828. set use-i/d-char off
  829. bind-to-key backward-paragraph ^[[
  830. bind-to-key current-error ^X^C
  831. bind-to-key exit-jove ^X^Z
  832. bind-to-key find-tag-at-point ^[^T
  833. bind-to-key grow-window ^Xg
  834. bind-to-key kill-s-expression ^[^K
  835. bind-to-key list-processes ^X^L
  836. bind-to-key scroll-down ^C
  837. bind-to-key shrink-window ^Xs
  838. END_OF_FILE
  839. if test 715 -ne `wc -c <'./doc/example.rc'`; then
  840.     echo shar: \"'./doc/example.rc'\" unpacked with wrong size!
  841. fi
  842. # end of './doc/example.rc'
  843. fi
  844. if test -f './doc/system.rc' -a "${1}" != "-c" ; then 
  845.   echo shar: Will not clobber existing file \"'./doc/system.rc'\"
  846. else
  847. echo shar: Extracting \"'./doc/system.rc'\" \(377 characters\)
  848. sed "s/^X//" >'./doc/system.rc' <<'END_OF_FILE'
  849. auto-execute-command auto-fill-mode /tmp/Re\|/tmp/article
  850. auto-execute-command show-match .*\.[lchy]$\|.*\.lisp$\|.*\.scm$\|.*\.slisp
  851. auto-execute-command c-mode .*\.[chy]$
  852. auto-execute-command lisp-mode .*\.l$\|.*\.lisp$\|.*\.scm$\|.*\.slisp
  853. bind-to-key pause-jove ^[S
  854. bind-to-key pause-jove ^[s
  855. process-bind-to-key interrupt-process ^C
  856. process-bind-to-key process-newline ^M
  857. END_OF_FILE
  858. if test 377 -ne `wc -c <'./doc/system.rc'`; then
  859.     echo shar: \"'./doc/system.rc'\" unpacked with wrong size!
  860. fi
  861. # end of './doc/system.rc'
  862. fi
  863. if test -f './doc/teachjove.nr' -a "${1}" != "-c" ; then 
  864.   echo shar: Will not clobber existing file \"'./doc/teachjove.nr'\"
  865. else
  866. echo shar: Extracting \"'./doc/teachjove.nr'\" \(726 characters\)
  867. sed "s/^X//" >'./doc/teachjove.nr' <<'END_OF_FILE'
  868. X.hy 0
  869. X.TH TEACHJOVE 1 "12 February 1986"
  870. X.ad
  871. X.SH NAME
  872. TEACHJOVE - learn how to use the JOVE editor
  873. X.SH SYNOPSIS
  874. teachjove
  875. X.SH DESCRIPTION
  876. TEACHJOVE is a simple program that calls up the JOVE editor on a special
  877. file that is an interactive tutorial for the JOVE editor.  Once in JOVE
  878. all you do is follow the instructions and by doing so you will learn all
  879. about JOVE!  NOTE: TEACHJOVE actually makes a copy of the tutorial in
  880. your home directory; if you ever want to start over (if you trash the
  881. file by accident) all you need to do is remove the file "~/teach-jove"
  882. and run teachjove again.
  883. X.SH FILES
  884. LIBDIR/teach-jove -- THE special file.
  885. X.SH SEE ALSO
  886. JOVE(1) - to learn about JOVE in general.
  887. X.fi
  888. X.SH AUTHOR
  889. Jonathan Payne
  890. END_OF_FILE
  891. if test 726 -ne `wc -c <'./doc/teachjove.nr'`; then
  892.     echo shar: \"'./doc/teachjove.nr'\" unpacked with wrong size!
  893. fi
  894. # end of './doc/teachjove.nr'
  895. fi
  896. if test -f './getch.c' -a "${1}" != "-c" ; then 
  897.   echo shar: Will not clobber existing file \"'./getch.c'\"
  898. else
  899. echo shar: Extracting \"'./getch.c'\" \(2453 characters\)
  900. sed "s/^X//" >'./getch.c' <<'END_OF_FILE'
  901. X/***************************************************************************
  902. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  903. X * is provided to you without charge, and with no warranty.  You may give  *
  904. X * away copies of JOVE, including sources, provided that this notice is    *
  905. X * included in all the files.                                              *
  906. X ***************************************************************************/
  907. X
  908. X#include "tune.h"
  909. X
  910. X#ifdef MSDOS
  911. X
  912. X#include <bios.h>
  913. X#include <dos.h>
  914. X
  915. X#include "jove.h"
  916. X
  917. X#ifdef LINT_ARGS
  918. private void waitfun(void);
  919. X#else
  920. private void waitfun();
  921. X#endif
  922. X
  923. extern int UpdModLine;
  924. X#ifdef IBMPC
  925. static char last = 0;
  926. extern int specialkey;
  927. X#endif
  928. X
  929. getrawinchar()
  930. X{
  931. X#ifdef RAINBOW
  932. X    union REGS regs;
  933. X#endif /* RAINBOW */
  934. X#ifdef IBMPC
  935. X    unsigned scan;
  936. X    
  937. X    if (specialkey = last) {
  938. X        scan = last;
  939. X        last = 0;
  940. X        return scan;
  941. X    }
  942. X#endif /* IBMPC */
  943. X
  944. X    while (!rawkey_ready())
  945. X        waitfun();
  946. X
  947. X#ifdef IBMPC
  948. X    scan = _bios_keybrd(_KEYBRD_READ);
  949. X    if ((scan&0xff) == 0) {
  950. X        last = (char) (scan >> 8);
  951. X        return 0xff;
  952. X    }
  953. X    return scan&0xff;
  954. X#else /* IBMPC */
  955. X#ifdef RAINBOW
  956. waitloop:
  957. X    regs.x.di = 2;
  958. X    int86(0x18, ®s, ®s);
  959. X    if (regs.h.al != 0)    /* should never happen, but who knows */
  960. X        return regs.h.al;
  961. X    else
  962. X        goto waitloop;
  963. X#else /* RAINBOW */
  964. X    return bdos(0x06, 0x00ff, 0xff) & 0xff;
  965. X#endif /* RAINBOW */
  966. X#endif /* IBMPC */
  967. X}
  968. X
  969. static int waiting = 0;
  970. X
  971. rawkey_ready()
  972. X{
  973. X#ifndef IBMPC
  974. X    union REGS regs;
  975. X#endif
  976. X
  977. X    if (waiting)
  978. X        return 0;
  979. X#ifdef IBMPC
  980. X    if (last) 
  981. X        return 1;
  982. X
  983. X    return _bios_keybrd(_KEYBRD_READY);
  984. X#else /* IBMPC */
  985. X#ifdef RAINBOW
  986. X    regs.x.di = 4;
  987. X    int86(0x18, ®s, ®s);
  988. X    return regs.h.cl != 0;
  989. X#else /* RAINBOW */
  990. X    regs.h.ah = 0x44;        /* ioctl call */
  991. X    regs.x.bx = 0;            /* stdin file handle */
  992. X    regs.h.al = 0x06;        /* get input status */
  993. X    intdos(®s, ®s);
  994. X    return regs.h.al & 1;
  995. X#endif /* RAINBOW */
  996. X#endif /* IBMPC */
  997. X}
  998. X
  999. X#ifdef IBMPC
  1000. static long timecount, lastcount = 0;
  1001. X#else
  1002. static char lastmin = 0;
  1003. X#endif
  1004. X
  1005. X
  1006. private void
  1007. waitfun()
  1008. X{
  1009. X#ifndef IBMPC
  1010. X    struct dostime_t tc;
  1011. X#endif
  1012. X
  1013. X    if (UpdModLine) {
  1014. X        waiting = 1;
  1015. X        redisplay();
  1016. X        waiting = 0;
  1017. X        return;
  1018. X    }
  1019. X#ifdef IBMPC
  1020. X    if (_bios_timeofday(_TIME_GETCLOCK, &timecount) ||  /* after midnight */
  1021. X            (timecount > lastcount + 0x444) ) {
  1022. X        lastcount = timecount;
  1023. X        UpdModLine = 1;
  1024. X    }
  1025. X#else
  1026. X    _dos_gettime(&tc);
  1027. X    if (tc.minute != lastmin) {
  1028. X        UpdModLine = 1;
  1029. X        lastmin = tc.minute;
  1030. X    }
  1031. X#endif
  1032. X}
  1033. X
  1034. X#endif /* MSDOS */
  1035. END_OF_FILE
  1036. if test 2453 -ne `wc -c <'./getch.c'`; then
  1037.     echo shar: \"'./getch.c'\" unpacked with wrong size!
  1038. fi
  1039. # end of './getch.c'
  1040. fi
  1041. if test -f './io.h' -a "${1}" != "-c" ; then 
  1042.   echo shar: Will not clobber existing file \"'./io.h'\"
  1043. else
  1044. echo shar: Extracting \"'./io.h'\" \(1502 characters\)
  1045. sed "s/^X//" >'./io.h' <<'END_OF_FILE'
  1046. X/***************************************************************************
  1047. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1048. X * is provided to you without charge, and with no warranty.  You may give  *
  1049. X * away copies of JOVE, including sources, provided that this notice is    *
  1050. X * included in all the files.                                              *
  1051. X ***************************************************************************/
  1052. X
  1053. X#define putchar(c)    putc(c, stdout)
  1054. X#define putc(c, fp)    (--(fp)->f_cnt >= 0 ? (*(fp)->f_ptr++ = (c)) : _flush((c), fp))
  1055. X#define getc(fp)    (((--(fp)->f_cnt < 0) ? filbuf(fp) : *(fp)->f_ptr++))
  1056. X
  1057. typedef struct File {
  1058. X    int    f_cnt,        /* number of characters left in buffer */
  1059. X        f_bufsize,    /* size of what f_base points to */
  1060. X        f_fd,        /* fildes */
  1061. X        f_flags;    /* various flags */
  1062. X    char    *f_ptr,        /* current offset */
  1063. X        *f_base;    /* pointer to base */
  1064. X    char    *f_name;    /* name of open file */
  1065. X} File;
  1066. X
  1067. X#define F_READ        01
  1068. X#define F_WRITE        02
  1069. X#define F_APPEND    04
  1070. X#define F_MODE(x)    (x&07)
  1071. X#define F_EOF        010
  1072. X#define F_STRING    020
  1073. X#define F_ERR        040
  1074. X#define F_LOCKED    0100    /* don't close this file upon error */
  1075. X#define F_MYBUF        0200    /* f_alloc allocated the buffer, so
  1076. X                   f_close knows to free it up */
  1077. X#define F_TELLALL    0400    /* whether to display info upon close */
  1078. X
  1079. extern long    io_chars;
  1080. extern int    io_lines;
  1081. X
  1082. extern File
  1083. X    *stdout,
  1084. X
  1085. X    *open_file(),
  1086. X    *fd_open(),
  1087. X    *f_open();
  1088. X
  1089. X#ifdef VMUNIX
  1090. X#   define MAXTTYBUF    2048
  1091. X#else
  1092. X#   define MAXTTYBUF    512
  1093. X#endif
  1094. END_OF_FILE
  1095. if test 1502 -ne `wc -c <'./io.h'`; then
  1096.     echo shar: \"'./io.h'\" unpacked with wrong size!
  1097. fi
  1098. # end of './io.h'
  1099. fi
  1100. if test -f './macvert.c' -a "${1}" != "-c" ; then 
  1101.   echo shar: Will not clobber existing file \"'./macvert.c'\"
  1102. else
  1103. echo shar: Extracting \"'./macvert.c'\" \(3170 characters\)
  1104. sed "s/^X//" >'./macvert.c' <<'END_OF_FILE'
  1105. X/***************************************************************************
  1106. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1107. X * is provided to you without charge, and with no warranty.  You may give  *
  1108. X * away copies of JOVE, including sources, provided that this notice is    *
  1109. X * included in all the files.                                              *
  1110. X ***************************************************************************/
  1111. X
  1112. X/* Macvert converts old style macro files to the new style.  The old
  1113. X   style macros were binary files, the new ones are text files suitable
  1114. X   for loading with the "source" command of JOVE. */
  1115. X
  1116. X#include <stdio.h>
  1117. X
  1118. extern int    read(),
  1119. X        write();
  1120. X
  1121. int    mac_fd;
  1122. X
  1123. mac_io(fcn, ptr, nbytes)
  1124. int    (*fcn)();
  1125. char    *ptr;
  1126. X{
  1127. X    int    nio;
  1128. X
  1129. X    if ((nio = (*fcn)(mac_fd, ptr, nbytes)) != nbytes)
  1130. X        fprintf(stderr, "[Macro %s error: %d got %d]",
  1131. X             (fcn == read) ? "read" : "write",
  1132. X             nbytes,
  1133. X             nio);
  1134. X}
  1135. X
  1136. X#define NEWWAY    1
  1137. X#define OLDWAY    0
  1138. X
  1139. int    int_how = NEWWAY;
  1140. X
  1141. X/* Formatting int's the old way or the new "improved" way? */
  1142. X
  1143. X#if vax || pdp11
  1144. long htonl(x)
  1145. register long x;
  1146. X{
  1147. X    return(    (((x >>  0) & 0377) << 24) |
  1148. X        (((x >>  8) & 0377) << 16) |
  1149. X        (((x >> 16) & 0377) <<  8) |
  1150. X        (((x >> 24) & 0377) <<  0) );
  1151. X}
  1152. X
  1153. short htons(x)
  1154. register short x;
  1155. X{
  1156. X    return(    (((x >>  0) & 0377) << 8) |
  1157. X        (((x >>  8) & 0377) << 0) );
  1158. X}
  1159. X
  1160. long ntohl(x)
  1161. register long x;
  1162. X{
  1163. X    return(    (((x >>  0) & 0377) << 24) |
  1164. X        (((x >>  8) & 0377) << 16) |
  1165. X        (((x >> 16) & 0377) <<  8) |
  1166. X        (((x >> 24) & 0377) <<  0) );
  1167. X}
  1168. X
  1169. short ntohs(x)
  1170. register short x;
  1171. X{
  1172. X    return(    (((x >>  0) & 0377) << 8) |
  1173. X        (((x >>  8) & 0377) << 0) );
  1174. X}
  1175. X#else
  1176. long htonl(x)
  1177. register long x;
  1178. X{
  1179. X    return(x);
  1180. X}
  1181. X
  1182. short htons(x)
  1183. register short x;
  1184. X{
  1185. X    return(x);
  1186. X}
  1187. X
  1188. long ntohl(x)
  1189. register long x;
  1190. X{
  1191. X    return(x);
  1192. X}
  1193. X
  1194. short ntohs(x)
  1195. register short x;
  1196. X{
  1197. X    return(x);
  1198. X}
  1199. X#endif
  1200. X
  1201. int_fmt(i)
  1202. X{
  1203. X    if (int_how == NEWWAY)
  1204. X        return ntohl(i);
  1205. X    return i;
  1206. X}
  1207. X
  1208. read_and_write_macros(filein)
  1209. char    *filein;
  1210. X{
  1211. X    int    namelen,
  1212. X        bodylen,
  1213. X        tmp;
  1214. X    char    macname[256],
  1215. X        macbuf[1024];
  1216. X
  1217. X    if ((mac_fd = open(filein, 0)) == -1)
  1218. X        fprintf(stderr, "Cannot open %s\n", filein);
  1219. X
  1220. X    while (read(mac_fd, (char *) &tmp, sizeof tmp) == (sizeof tmp)) {
  1221. retry:        bodylen = int_fmt(tmp);
  1222. X        if (bodylen <= 0 || bodylen > 10000) {
  1223. X            if (int_how == NEWWAY) {
  1224. X                int_how = OLDWAY;
  1225. X                goto retry;
  1226. X            } else {
  1227. X                fprintf(stderr, "I don't think \"%s\" is an old style JOVE macro file\n", filein);
  1228. X                exit(1);
  1229. X            }
  1230. X        }
  1231. X        mac_io(read, (char *) &namelen, sizeof namelen);
  1232. X        namelen = int_fmt(namelen);
  1233. X        mac_io(read, macname, namelen);
  1234. X        mac_io(read, macbuf, bodylen);
  1235. X        output_new_definition(macname, macbuf, bodylen);
  1236. X    }        
  1237. X}
  1238. X
  1239. pr_putc(c)
  1240. X{
  1241. X    if (c == '\\' || c == '^')
  1242. X        putchar('\\');
  1243. X     else if (c < ' ' || c == '\177') {
  1244. X        putchar('^');
  1245. X        c = (c == '\177') ? '?' : (c + '@');
  1246. X    }
  1247. X    putchar(c);
  1248. X}
  1249. X
  1250. output_new_definition(name, body, bodylen)
  1251. char    *name,
  1252. X    *body;
  1253. X{
  1254. X    int    i;
  1255. X
  1256. X    fprintf(stdout, "define-macro %s ", name);
  1257. X    for (i = 0; i < bodylen; i++)
  1258. X        pr_putc(body[i]);
  1259. X    putchar('\n');
  1260. X}
  1261. X
  1262. main(argc, argv)
  1263. char    *argv[];
  1264. X{
  1265. X    if (argc != 2) {
  1266. X        fprintf(stderr, "usage: macvert <old-style-macro-file>\n");
  1267. X        exit(1);
  1268. X    }
  1269. X
  1270. X    read_and_write_macros(argv[1]);
  1271. X}
  1272. END_OF_FILE
  1273. if test 3170 -ne `wc -c <'./macvert.c'`; then
  1274.     echo shar: \"'./macvert.c'\" unpacked with wrong size!
  1275. fi
  1276. # end of './macvert.c'
  1277. fi
  1278. if test -f './menumaps.txt' -a "${1}" != "-c" ; then 
  1279.   echo shar: Will not clobber existing file \"'./menumaps.txt'\"
  1280. else
  1281. echo shar: Extracting \"'./menumaps.txt'\" \(2539 characters\)
  1282. sed "s/^X//" >'./menumaps.txt' <<'END_OF_FILE'
  1283. X/************************************************************************
  1284. X * This program is Copyright (C) 1986 by Jonathan Payne.  JOVE is    *
  1285. X * provided to you without charge, and with no warranty.  You may give    *
  1286. X * away copies of JOVE, including sources, provided that this notice is *
  1287. X * included in all the files.                        *
  1288. X ************************************************************************/
  1289. X
  1290. X/* menumaps.txt K. Mitchum 1/88. The same warnings apply as in keymaps.txt.
  1291. X   You MUST use a version of setmaps compiled with MAC defined for this
  1292. X   file to be converted correctly. */
  1293. X
  1294. X
  1295. X#include "jove.h"
  1296. X#include "mac.h"
  1297. X#MENU
  1298. data_obj MDIV = { STRING, "(-" };
  1299. data_obj MAJM = { STRING, "(Major Modes:" };
  1300. data_obj MINM = { STRING, "(Minor Modes:" };
  1301. data_obj BOOL = { STRING, "(Boolean:" };
  1302. data_obj DECM = { STRING, "(Decimal:" };
  1303. data_obj STRM = { STRING, "(String:" };
  1304. data_obj CHAR = { STRING, "(Character:" };
  1305. X#define MENU_DIV &MDIV
  1306. X
  1307. struct menu Menus[NMENUS] = {
  1308. X"File",101,0, {
  1309. X    "visit-file",
  1310. X    "find-file",
  1311. X    "insert-file",
  1312. X    MENU_DIV,
  1313. X    "save-file",
  1314. X    "write-file",
  1315. X    MENU_DIV,
  1316. X    "write-modified-files",
  1317. X    "write-region",
  1318. X    MENU_DIV,
  1319. X    "write-macros-to-file",
  1320. X    MENU_DIV,
  1321. X    "exit-jove",
  1322. X    0
  1323. X},
  1324. X
  1325. X"Buffer",103,0, {
  1326. X    &MAJM,
  1327. X    "c-mode",
  1328. X    "fundamental-mode",
  1329. X    "lisp-mode",
  1330. X    "text-mode",
  1331. X    &MINM,
  1332. X    "auto-fill-mode",
  1333. X    "auto-indent-mode",
  1334. X    "over-write-mode",
  1335. X    "show-match-mode",
  1336. X    "word-abbrev-mode",
  1337. X    MENU_DIV,
  1338. X    0
  1339. X},
  1340. X
  1341. X"Window",104,0, {
  1342. X    "grow-window",
  1343. X    "shrink-window",
  1344. X    MENU_DIV,
  1345. X    "split-current-window",
  1346. X    "delete-other-windows",
  1347. X    "window-find",
  1348. X    MENU_DIV,
  1349. X    "number-lines-in-window",
  1350. X    0
  1351. X},
  1352. X
  1353. X"Point",105,0, {
  1354. X    "set-mark",
  1355. X    "exchange-point-and-mark",
  1356. X    MENU_DIV,
  1357. X    "search-forward",
  1358. X    "search-reverse",
  1359. X    "i-search-forward",
  1360. X    "i-search-reverse",
  1361. X    "query-replace-string",
  1362. X    "replace-string",
  1363. X    MENU_DIV,
  1364. X    "find-tag",
  1365. X    0
  1366. X},
  1367. X
  1368. X"Command",106,0, {
  1369. X    "begin-kbd-macro",
  1370. X    "end-kbd-macro",
  1371. X    "name-kbd-macro",
  1372. X    "execute-kbd-macro",
  1373. X    "execute-macro",
  1374. X    MENU_DIV,
  1375. X    "bind-macro-to-key",
  1376. X    "bind-to-key",
  1377. X    "describe-key",
  1378. X    MENU_DIV,
  1379. X    "execute-named-command",
  1380. X    0
  1381. X},
  1382. X
  1383. X"Set",107,0, {
  1384. X    &BOOL,
  1385. X    "allow-bad-filenames",
  1386. X    "auto-case-abbrev",
  1387. X    "case-ignore-search",
  1388. X    "files-should-end-with-newline",
  1389. X    "macify",
  1390. X    "make-backup-files",
  1391. X    "marks-should-float",
  1392. X    "match-regular-expressions",
  1393. X    "send-typeout-to-buffer",
  1394. X    "wrap-search",
  1395. X    &DECM,
  1396. X    "c-indentation-increment",
  1397. X    "internal-tabstop",
  1398. X    "left-margin",
  1399. X    "mark-threshold",
  1400. X    "paren-flash-delay",
  1401. X    "right-margin",
  1402. X    "scroll-step",
  1403. X    "sync-frequency",
  1404. X    &STRM,
  1405. X    "comment-format",
  1406. X    "mode-line",
  1407. X    "tag-file",
  1408. X    &CHAR,
  1409. X    "abort-char",
  1410. X    0
  1411. X}
  1412. X};
  1413. X
  1414. END_OF_FILE
  1415. if test 2539 -ne `wc -c <'./menumaps.txt'`; then
  1416.     echo shar: \"'./menumaps.txt'\" unpacked with wrong size!
  1417. fi
  1418. # end of './menumaps.txt'
  1419. fi
  1420. if test -f './mjovers.Hqx' -a "${1}" != "-c" ; then 
  1421.   echo shar: Will not clobber existing file \"'./mjovers.Hqx'\"
  1422. else
  1423. echo shar: Extracting \"'./mjovers.Hqx'\" \(1105 characters\)
  1424. sed "s/^X//" >'./mjovers.Hqx' <<'END_OF_FILE'
  1425. X(This file must be converted with BinHex 4.0)
  1426. X
  1427. X:#QeUEhCP,R*cFQ-!2j!%5PB`-3#3#!1JIqJ!N!3"!*!$![i!!!(q!*!$SJ%,!3F
  1428. X""J%'!3F"#3%(!3J"#3%+!38!"J!'!3S"#`!(#QeUEhCP,R*cFQ0b!J#30Cj)c4F
  1429. X!N!B$S!-5!!N!!J#3!c-!N$+L!%e5J!#3$`(!!*!,!`#3"6!!!!)Dd!#3#"!!N"-
  1430. F5PB`-3#3!`&*3diM!*!&J%C548B!N!@!!*!("d&38%`!N!8"!2q3!`#J!!%![q-
  1431. X"`+!!!8#2rm&`J!!"8)2rm9b!!!&8Mrr"9)!!!95i!!&8J!!"92q3!e5!!!&8[q-
  1432. X"9)!!!952rm&8J!!"9)2rm95!!!&8Mrr"9)!!!95i!!&8J!!"92q3!e6rN!08)!!
  1433. X!9$rrrp3)!!!8$rrrp!)!!!3$rrrmrj!$!2q3!`$rN!2!rj!$`2q3!r$rN!2`rj!
  1434. X$r2q3!rcrN!2mrj!$r2q3!rcrN!2mrj!$r2q3!rcrN!2mrj!$r2q3!rcrN!2mrj!
  1435. X$r2q3!rcrN!2mrj!$r2q3!rcrN!2mrj!$r2q3!r`rrrrm2rrrr!rrrr`2rrrm!rr
  1436. rr!2rrr`!N!1Z!!B!N!@q!A)!dJ'Z"!*25`#3"5J!&!$`!8m!N!F$!"3!$3(##!*
  1437. H-!#3"3m!&!!M!A`)!Pia!*!&+!&H!$F"c!J2B#!p)%963d&345"VCANZ%J#3"6F
  1438. X"AJ"'!F`)%N0[E@eKEQ3JB#!p)'!JDf9j,J#3"8X"AJ"Z!F`))80[ER4bEf`J25"
  1439. X$EfeYB@jN)'pb)%0[ER4bEf`J5f9j,JJ!N!-9!*!%!33"c!!"!*!)"q3!N!-"!*!
  1440. X$![i!!!(q!*!$SJ!"h(B%DJ#3!a`!PJ!&3Nj%6!#3!c*+9M!a!*!$2NC548B!N!0
  1441. X+5801)`#3!eC%594-!*!$BN4-6dF!N!0Z!)$rr`#3"3(XXJ!!rrm!N!-J!!(Y!J#
  1442. X!rrm!N!-N!!(H8J#!rrm!N!-[!!(XpJINrrm!!!%c!!(XeJI3!*!%!H8!!HbL#d&
  1443. X#6e98AdT%6%p(Ep3:
  1444. END_OF_FILE
  1445. if test 1105 -ne `wc -c <'./mjovers.Hqx'`; then
  1446.     echo shar: \"'./mjovers.Hqx'\" unpacked with wrong size!
  1447. fi
  1448. # end of './mjovers.Hqx'
  1449. fi
  1450. if test -f './portsrv.c' -a "${1}" != "-c" ; then 
  1451.   echo shar: Will not clobber existing file \"'./portsrv.c'\"
  1452. else
  1453. echo shar: Extracting \"'./portsrv.c'\" \(3429 characters\)
  1454. sed "s/^X//" >'./portsrv.c' <<'END_OF_FILE'
  1455. X/***************************************************************************
  1456. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1457. X * is provided to you without charge, and with no warranty.  You may give  *
  1458. X * away copies of JOVE, including sources, provided that this notice is    *
  1459. X * included in all the files.                                              *
  1460. X ***************************************************************************/
  1461. X
  1462. X/* This is a server for jove sub processes.  It runs the command and
  1463. X   signals jove when there is some output ready to send to jove. By the
  1464. X   time we get here, out standard output goes to jove's process input. */
  1465. X
  1466. X#include "tune.h"
  1467. X
  1468. X#ifdef PIPEPROCS    /* the whole file! */
  1469. X
  1470. X#include "jove.h"
  1471. X
  1472. X#include <signal.h>
  1473. X#include <sys/ioctl.h>
  1474. X#ifdef BSD4_2
  1475. X#   include <sys/wait.h>
  1476. X#else
  1477. X#   include <wait.h>
  1478. X#endif
  1479. X
  1480. struct header {
  1481. X    int    pid;
  1482. X    int    nbytes;
  1483. X    char    buf[512];
  1484. X} header;
  1485. X
  1486. X#define HEADSIZE    ((sizeof header.pid) + sizeof (header.nbytes))
  1487. X
  1488. error(str)
  1489. char    *str;
  1490. X{
  1491. X    header.pid = getpid();
  1492. X    header.nbytes = strlen(str);
  1493. X    strcpy(header.buf, str);
  1494. X    proc_write(&header, header.nbytes + HEADSIZE);
  1495. X    exit(-2);
  1496. X}
  1497. X
  1498. int    ppid,
  1499. X    InputFD,
  1500. X    JovesInput;
  1501. X
  1502. p_inform()
  1503. X{
  1504. X    long    nbytes;
  1505. X
  1506. X    ioctl(JovesInput, FIONREAD, (char *) &nbytes);
  1507. X    if (nbytes > 0)
  1508. X        kill(ppid, INPUT_SIG);
  1509. X}
  1510. X
  1511. proc_write(ptr, n)
  1512. char    *ptr;
  1513. X{
  1514. X    long    nbytes;
  1515. X
  1516. X    ioctl(1, FIONREAD, (char *) &nbytes);
  1517. X    
  1518. X    if (nbytes == 0)
  1519. X        kill(ppid, INPUT_SIG);
  1520. X
  1521. X    (void) write(1, ptr, n);
  1522. X    alarm(1);
  1523. X}
  1524. X
  1525. read_pipe()
  1526. X{
  1527. X    register int    n;
  1528. X    
  1529. X    (void) signal(SIGALRM, p_inform);
  1530. X
  1531. X    while ((header.nbytes = read(InputFD, header.buf, sizeof header.buf)) > 0) {
  1532. X        n = HEADSIZE + header.nbytes;
  1533. X        proc_write(&header, n);
  1534. X    }
  1535. X}
  1536. X
  1537. X/* ARGSUSED */
  1538. main(argc, argv)
  1539. char    *argv[];
  1540. X{
  1541. X    int    p[2];
  1542. X    int    pid;
  1543. X    int    tty_fd,
  1544. X        i;
  1545. X
  1546. X/*    tty_fd = open("/dev/tty", 1); */
  1547. X
  1548. X    if (pipe(p) == -1)
  1549. X        error("Cannot pipe jove portsrv.\n");
  1550. X
  1551. X/*    for (i = 0; i < argc; i++) {
  1552. X        write(tty_fd, "*argv++ = ", 10);
  1553. X        write(tty_fd, argv[i], strlen(argv[i]));
  1554. X        write(tty_fd, "\n", 1);
  1555. X    } */
  1556. X
  1557. X    ppid = getppid();
  1558. X    switch (pid = fork()) {
  1559. X    case -1:
  1560. X        error("portsrv: cannot fork.\n");
  1561. X
  1562. X    case 0:
  1563. X        /* We'll intercept childs output in p[0] */
  1564. X        (void) dup2(p[1], 1);
  1565. X        (void) dup2(p[1], 2);
  1566. X        (void) close(p[0]);
  1567. X        (void) close(p[1]);
  1568. X            
  1569. X        (void) setpgrp(getpid(), getpid());
  1570. X        execv(argv[2], &argv[3]);
  1571. X        _exit(-4);
  1572. X
  1573. X    default:
  1574. X        (void) close(0);
  1575. X
  1576. X         /* don't want this guy to read anything jove sends to
  1577. X            our soon to be created child */
  1578. X
  1579. X        JovesInput = atoi(argv[1]);
  1580. X        (void) signal(SIGINT, SIG_IGN);
  1581. X        (void) signal(SIGQUIT, SIG_IGN);
  1582. X        (void) close(p[1]);
  1583. X
  1584. X        /* tell jove the pid of the real child as opposed to us */
  1585. X        header.pid = getpid();
  1586. X        header.nbytes = sizeof (int);
  1587. X        *(int *) header.buf = pid;
  1588. X        (void) write(1, (char *) &header, sizeof pid + HEADSIZE);
  1589. X        p_inform();    /* Inform jove */
  1590. X
  1591. X        /* read proc's output and send it to jove */
  1592. X        InputFD = p[0];
  1593. X        read_pipe();
  1594. X        (void) close(p[0]);
  1595. X        header.pid = getpid();
  1596. X        header.nbytes = EOF;    /* tell jove we are finished */
  1597. X        (void) write(1, (char *) &header, HEADSIZE);
  1598. X        p_inform();
  1599. X        /* try to exit like our child did ... */
  1600. X        {
  1601. X            union wait    w;
  1602. X
  1603. X#ifndef BSD4_2
  1604. X            while (wait2(&w.w_status, 0) != pid)
  1605. X#else
  1606. X            while (wait3(&w.w_status, 0, 0) != pid)
  1607. X#endif
  1608. X                ;
  1609. X            if (WIFEXITED(w))
  1610. X                exit(w.w_retcode);
  1611. X            else if (WIFSIGNALED(w))
  1612. X                kill(getpid(), w.w_termsig);
  1613. X        }
  1614. X    }
  1615. X}
  1616. X
  1617. X#else /* PIPEPROCS */
  1618. main()
  1619. X{
  1620. X}
  1621. X#endif
  1622. END_OF_FILE
  1623. if test 3429 -ne `wc -c <'./portsrv.c'`; then
  1624.     echo shar: \"'./portsrv.c'\" unpacked with wrong size!
  1625. fi
  1626. # end of './portsrv.c'
  1627. fi
  1628. if test -f './re.h' -a "${1}" != "-c" ; then 
  1629.   echo shar: Will not clobber existing file \"'./re.h'\"
  1630. else
  1631. echo shar: Extracting \"'./re.h'\" \(874 characters\)
  1632. sed "s/^X//" >'./re.h' <<'END_OF_FILE'
  1633. X/***************************************************************************
  1634. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1635. X * is provided to you without charge, and with no warranty.  You may give  *
  1636. X * away copies of JOVE, including sources, provided that this notice is    *
  1637. X * included in all the files.                                              *
  1638. X ***************************************************************************/
  1639. X
  1640. X#define NALTS    10    /* number of alternate search strings */
  1641. X
  1642. extern char    searchstr[128],
  1643. X        compbuf[128],        /* global default compbuf */
  1644. X        rep_search[128],    /* replace search string */
  1645. X        rep_str[128],        /* contains replacement string */
  1646. X        *cur_compb,        /* usually points at compbuf */
  1647. X        REbuf[LBSIZE],        /* points at line we're scanning */
  1648. X        *alternates[NALTS];
  1649. X
  1650. extern int    REdirection,
  1651. X        REeom,
  1652. X        REbom,
  1653. X        REalt_num;
  1654. END_OF_FILE
  1655. if test 874 -ne `wc -c <'./re.h'`; then
  1656.     echo shar: \"'./re.h'\" unpacked with wrong size!
  1657. fi
  1658. # end of './re.h'
  1659. fi
  1660. if test -f './rec.c' -a "${1}" != "-c" ; then 
  1661.   echo shar: Will not clobber existing file \"'./rec.c'\"
  1662. else
  1663. echo shar: Extracting \"'./rec.c'\" \(3912 characters\)
  1664. sed "s/^X//" >'./rec.c' <<'END_OF_FILE'
  1665. X/***************************************************************************
  1666. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1667. X * is provided to you without charge, and with no warranty.  You may give  *
  1668. X * away copies of JOVE, including sources, provided that this notice is    *
  1669. X * included in all the files.                                              *
  1670. X ***************************************************************************/
  1671. X
  1672. X#include "jove.h"
  1673. X#include "io.h"
  1674. X#include "rec.h"
  1675. X
  1676. X#ifndef MAC
  1677. X#    include <sys/file.h>
  1678. X#endif
  1679. X
  1680. private int    rec_fd = -1;
  1681. private char    *recfname;
  1682. private File    *rec_out;
  1683. X
  1684. X#ifndef L_SET
  1685. X#    define L_SET 0
  1686. X#endif
  1687. X
  1688. private struct rec_head    Header;
  1689. X
  1690. recinit()
  1691. X{
  1692. X    char    buf[128];
  1693. X
  1694. X#ifdef MAC
  1695. X    sprintf(buf, "%s/%s", HomeDir, p_tempfile);
  1696. X#else
  1697. X    sprintf(buf, "%s/%s", TmpFilePath, p_tempfile);
  1698. X#endif
  1699. X    recfname = copystr(buf);
  1700. X    recfname = mktemp(recfname);
  1701. X    rec_fd = creat(recfname, 0644);
  1702. X    if (rec_fd == -1) {
  1703. X        complain("Cannot create \"%s\"; recovery disabled.", recfname);
  1704. X        return;
  1705. X    }
  1706. X    /* initialize the record IO */
  1707. X    rec_out = fd_open(recfname, F_WRITE|F_LOCKED, rec_fd, iobuff, LBSIZE);
  1708. X
  1709. X    /* Initialize the record header. */
  1710. X    Header.Uid = getuid();
  1711. X    Header.Pid = getpid();
  1712. X    Header.UpdTime = 0L;
  1713. X    Header.Nbuffers = 0;
  1714. X    (void) write(rec_fd, (char *) &Header, sizeof Header);
  1715. X}
  1716. X
  1717. recclose()
  1718. X{
  1719. X    if (rec_fd == -1)
  1720. X        return;
  1721. X    (void) close(rec_fd);
  1722. X    rec_fd = -1;
  1723. X    (void) unlink(recfname);
  1724. X}
  1725. X
  1726. private
  1727. putaddr(addr, p)
  1728. disk_line    addr;
  1729. register File    *p;
  1730. X{
  1731. X    register char    *cp = (char *) &addr;
  1732. X    register int    nchars = sizeof (disk_line);
  1733. X
  1734. X    while (--nchars >= 0)
  1735. X        putc(*cp++ & 0377, p);
  1736. X}
  1737. X
  1738. private
  1739. putn(cp, nbytes)
  1740. register char    *cp;
  1741. register int    nbytes;
  1742. X{
  1743. X    while (--nbytes >= 0)
  1744. X        putc(*cp++ & 0377, rec_out);
  1745. X}
  1746. X
  1747. X/* Write out the line pointers for buffer B. */
  1748. X
  1749. private
  1750. dmppntrs(b)
  1751. register Buffer    *b;
  1752. X{
  1753. X    register Line    *lp;
  1754. X
  1755. X    for (lp = b->b_first; lp != 0; lp = lp->l_next)
  1756. X        putaddr(lp->l_dline, rec_out);
  1757. X}
  1758. X
  1759. X/* dump the buffer info and then the actual line pointers. */
  1760. X
  1761. private
  1762. dmp_buf_header(b)
  1763. register Buffer    *b;
  1764. X{
  1765. X    struct rec_entry    record;
  1766. X    register Line    *lp;
  1767. X    register int    nlines = 0;
  1768. X
  1769. X    for (lp = b->b_first; lp != 0; lp = lp->l_next, nlines++)
  1770. X        if (lp == b->b_dot)
  1771. X            record.r_dotline = nlines;
  1772. X    strcpy(record.r_fname, b->b_fname ? b->b_fname : NullStr);
  1773. X    strcpy(record.r_bname, b->b_name);
  1774. X    record.r_nlines = nlines;
  1775. X    record.r_dotchar = b->b_char;
  1776. X    putn((char *) &record, sizeof record);
  1777. X}
  1778. X
  1779. X/* Goes through all the buffers and syncs them to the disk. */
  1780. X
  1781. int    SyncFreq = 50;
  1782. X
  1783. SyncRec()
  1784. X{
  1785. X    extern disk_line    DFree;
  1786. X    register Buffer    *b;
  1787. X    static int    beenhere = NO;
  1788. X
  1789. X    if (beenhere == NO) {
  1790. X        recinit();    /* Init recover file. */
  1791. X        beenhere = YES;
  1792. X    }
  1793. X    if (rec_fd == -1)
  1794. X        return;
  1795. X    lseek(rec_fd, 0L, L_SET);
  1796. X    (void) time(&Header.UpdTime);
  1797. X    Header.Nbuffers = 0;
  1798. X    for (b = world; b != 0; b = b->b_next)
  1799. X        if (b->b_type == B_SCRATCH || !IsModified(b))
  1800. X            continue;
  1801. X        else
  1802. X            Header.Nbuffers += 1;
  1803. X    Header.FreePtr = DFree;
  1804. X    putn((char *) &Header, sizeof Header);
  1805. X    if (Header.Nbuffers != 0) {
  1806. X        lsave();    /* this makes things really right */
  1807. X        SyncTmp();
  1808. X        for (b = world; b != 0; b = b->b_next)
  1809. X            if (b->b_type == B_SCRATCH || !IsModified(b))
  1810. X                continue;
  1811. X            else
  1812. X                dmp_buf_header(b);
  1813. X        for (b = world; b != 0; b = b->b_next)
  1814. X            if (b->b_type == B_SCRATCH || !IsModified(b))
  1815. X                continue;
  1816. X            else
  1817. X                dmppntrs(b);
  1818. X    }
  1819. X    flush(rec_out);
  1820. X}
  1821. X
  1822. X/* Full Recover.  What we have to do is go find the name of the tmp
  1823. X   file data/rec pair and use those instead of the ones we would have
  1824. X   created eventually.  The rec file has a list of buffers, and then
  1825. X   the actual pointers.  Stored for each buffer is the buffer name,
  1826. X   the file name, the number of lines, the current line, the current
  1827. X   character.  The current modes do not need saving as they will be
  1828. X   saved when the file name is set.  If a process was running in a
  1829. X   buffer, it will be lost. */
  1830. X
  1831. FullRecover()
  1832. X{
  1833. X}
  1834. END_OF_FILE
  1835. if test 3912 -ne `wc -c <'./rec.c'`; then
  1836.     echo shar: \"'./rec.c'\" unpacked with wrong size!
  1837. fi
  1838. # end of './rec.c'
  1839. fi
  1840. if test -f './rec.h' -a "${1}" != "-c" ; then 
  1841.   echo shar: Will not clobber existing file \"'./rec.h'\"
  1842. else
  1843. echo shar: Extracting \"'./rec.h'\" \(826 characters\)
  1844. sed "s/^X//" >'./rec.h' <<'END_OF_FILE'
  1845. X/***************************************************************************
  1846. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1847. X * is provided to you without charge, and with no warranty.  You may give  *
  1848. X * away copies of JOVE, including sources, provided that this notice is    *
  1849. X * included in all the files.                                              *
  1850. X ***************************************************************************/
  1851. X
  1852. struct rec_head {
  1853. X    int        Uid,        /* uid of owner */
  1854. X            Pid;        /* pid of jove process */
  1855. X    time_t        UpdTime;    /* last time this was updated */
  1856. X    int        Nbuffers;    /* number of buffers */
  1857. X    disk_line    FreePtr;    /* position of DFree */
  1858. X};
  1859. X
  1860. struct rec_entry {
  1861. X    char    r_bname[128],
  1862. X        r_fname[128];
  1863. X    int    r_nlines,
  1864. X        r_dotline,    /* so we can really save the context */
  1865. X        r_dotchar;
  1866. X};
  1867. END_OF_FILE
  1868. if test 826 -ne `wc -c <'./rec.h'`; then
  1869.     echo shar: \"'./rec.h'\" unpacked with wrong size!
  1870. fi
  1871. # end of './rec.h'
  1872. fi
  1873. if test -f './table.c' -a "${1}" != "-c" ; then 
  1874.   echo shar: Will not clobber existing file \"'./table.c'\"
  1875. else
  1876. echo shar: Extracting \"'./table.c'\" \(1145 characters\)
  1877. sed "s/^X//" >'./table.c' <<'END_OF_FILE'
  1878. X/***************************************************************************
  1879. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1880. X * is provided to you without charge, and with no warranty.  You may give  *
  1881. X * away copies of JOVE, including sources, provided that this notice is    *
  1882. X * included in all the files.                                              *
  1883. X ***************************************************************************/
  1884. X
  1885. X#include "jove.h"
  1886. X#include "table.h"
  1887. X
  1888. private Table    *tables = NIL;
  1889. X
  1890. Table *
  1891. make_table()
  1892. X{
  1893. X    Table    *tab = (Table *) emalloc(sizeof *tab);
  1894. X
  1895. X    tab->t_next = tables;
  1896. X    tables = tab;
  1897. X    tab->t_wordlist = NIL;
  1898. X
  1899. X    return tab;
  1900. X}
  1901. X
  1902. Word *
  1903. word_in_table(text, table)
  1904. char    *text;
  1905. Table    *table;
  1906. X{
  1907. X    register Word    *w;
  1908. X
  1909. X    for (w = table_top(table); w != NIL; w = next_word(w))
  1910. X        if (strcmp(word_text(w), text) == 0)
  1911. X            break;    /* already in list */
  1912. X    return w;
  1913. X}
  1914. X
  1915. void
  1916. add_word(wname, table)
  1917. char    *wname;
  1918. Table    *table;
  1919. X{
  1920. X    register Word    *w;
  1921. X
  1922. X    if (w = word_in_table(wname, table))
  1923. X        return;
  1924. X    w = (Word *) emalloc(sizeof *w);
  1925. X    word_text(w) = wname;
  1926. X    next_word(w) = table_top(table);
  1927. X    table_top(table) = w;
  1928. X}
  1929. END_OF_FILE
  1930. if test 1145 -ne `wc -c <'./table.c'`; then
  1931.     echo shar: \"'./table.c'\" unpacked with wrong size!
  1932. fi
  1933. # end of './table.c'
  1934. fi
  1935. if test -f './table.h' -a "${1}" != "-c" ; then 
  1936.   echo shar: Will not clobber existing file \"'./table.h'\"
  1937. else
  1938. echo shar: Extracting \"'./table.h'\" \(888 characters\)
  1939. sed "s/^X//" >'./table.h' <<'END_OF_FILE'
  1940. X/***************************************************************************
  1941. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1942. X * is provided to you without charge, and with no warranty.  You may give  *
  1943. X * away copies of JOVE, including sources, provided that this notice is    *
  1944. X * included in all the files.                                              *
  1945. X ***************************************************************************/
  1946. X
  1947. typedef struct word    Word;
  1948. typedef struct table    Table;
  1949. X
  1950. struct word {
  1951. X    Word    *wd_next;
  1952. X    char    *wd_text;
  1953. X};
  1954. X
  1955. struct table {
  1956. X    Table    *t_next;
  1957. X    Word    *t_wordlist;
  1958. X};
  1959. X
  1960. extern Table    *make_table();
  1961. extern Word    *word_in_table();
  1962. X
  1963. X#define    table_top(table)    (table->t_wordlist)
  1964. X#define next_word(w)        (w->wd_next)
  1965. X#define last_word_p(w)        (w->wd_next == NIL)
  1966. X#define word_text(w)        (w->wd_text)
  1967. X#define word_length(w)        (strlen(word_text(w)))
  1968. END_OF_FILE
  1969. if test 888 -ne `wc -c <'./table.h'`; then
  1970.     echo shar: \"'./table.h'\" unpacked with wrong size!
  1971. fi
  1972. # end of './table.h'
  1973. fi
  1974. if test -f './teachjove.c' -a "${1}" != "-c" ; then 
  1975.   echo shar: Will not clobber existing file \"'./teachjove.c'\"
  1976. else
  1977. echo shar: Extracting \"'./teachjove.c'\" \(1070 characters\)
  1978. sed "s/^X//" >'./teachjove.c' <<'END_OF_FILE'
  1979. X/***************************************************************************
  1980. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  1981. X * is provided to you without charge, and with no warranty.  You may give  *
  1982. X * away copies of JOVE, including sources, provided that this notice is    *
  1983. X * included in all the files.                                              *
  1984. X ***************************************************************************/
  1985. X
  1986. X#include <sys/types.h>
  1987. X#include <sys/file.h>
  1988. X
  1989. X#ifndef TEACHJOVE
  1990. X#    define TEACHJOVE    "/usr/lib/jove/teach-jove"
  1991. X#endif
  1992. X
  1993. X#ifndef W_OK
  1994. X#   define W_OK    2
  1995. X#   define F_OK    0
  1996. X#endif
  1997. X
  1998. extern char    *getenv();
  1999. X
  2000. main()
  2001. X{
  2002. X    char    cmd[256],
  2003. X        fname[256],
  2004. X        *home;
  2005. X
  2006. X    if ((home = getenv("HOME")) == 0) {
  2007. X        printf("teachjove: cannot find your home!\n");
  2008. X        exit(-1);
  2009. X    }
  2010. X    (void) sprintf(fname, "%s/teach-jove", home);
  2011. X    if (access(fname, F_OK) != 0) {
  2012. X        (void) sprintf(cmd, "cp %s %s", TEACHJOVE, fname);
  2013. X        system(cmd);
  2014. X    }
  2015. X    (void) execlp("jove", "teachjove", fname, (char *) 0);
  2016. X    printf("teachjove: cannot execl jove!\n");
  2017. X}
  2018. X
  2019. END_OF_FILE
  2020. if test 1070 -ne `wc -c <'./teachjove.c'`; then
  2021.     echo shar: \"'./teachjove.c'\" unpacked with wrong size!
  2022. fi
  2023. # end of './teachjove.c'
  2024. fi
  2025. if test -f './temp.h' -a "${1}" != "-c" ; then 
  2026.   echo shar: Will not clobber existing file \"'./temp.h'\"
  2027. else
  2028. echo shar: Extracting \"'./temp.h'\" \(4029 characters\)
  2029. sed "s/^X//" >'./temp.h' <<'END_OF_FILE'
  2030. X/***************************************************************************
  2031. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  2032. X * is provided to you without charge, and with no warranty.  You may give  *
  2033. X * away copies of JOVE, including sources, provided that this notice is    *
  2034. X * included in all the files.                                              *
  2035. X ***************************************************************************/
  2036. X
  2037. X/* The tmp file is indexed in chunks of CH_SIZE characters.  CH_SIZE is
  2038. X   (1 << CH_BITS).  New lines are added to the end of the tmp file.  The
  2039. X   file is not garbage collected because that would be too painful.  As a
  2040. X   result, commands like Yank and Kill are really easy; basically all we
  2041. X   do is make copies of the disk addresses of the lines (as opposed to
  2042. X   the contents).  So, putline(buf) writes BUF to the disk and returns a
  2043. X   new disk address.  Getline(addr, buf) is the opposite of putline().
  2044. X   f_getputl(line, fp) reads from open FP directly into the tmp file (into
  2045. X   the buffer cache (see below)) and stores the address in LINE.  This is
  2046. X   used during read_file to minimize compying.
  2047. X
  2048. X   Lines do NOT cross block bounderies in the tmp file so that accessing
  2049. X   the contents of lines can be much faster.  Pointers to offsets into
  2050. X   disk buffers are returned instead of copying the contents into local
  2051. X   arrays and then using them.  This cuts down on the amount of copying a
  2052. X   great deal, at the expense of less efficiency.  The lower bit of disk
  2053. X   addresses is used for marking lines as needing redisplay done.
  2054. X
  2055. X   There is a buffer cache of NBUF buffers (64 on !SMALL machines and the
  2056. X   3 on small ones).  The blocks are stored in LRU order and each block
  2057. X   is also stored in a hash table by block #.  When a block is requested
  2058. X   it can quickly be looked up in the hash table.  If it's not there the
  2059. X   LRU block is assigned the new block #.  If it finds that the LRU block
  2060. X   is dirty (i.e., has pending IO) it syncs the WHOLE tmp file, i.e.,
  2061. X   does all the pending writes.  This works much better on floppy disk
  2062. X   systems, like the IBM PC, if the blocks are sorted before sync'ing. */
  2063. X
  2064. X#ifdef SMALL
  2065. X#   define CH_BITS        4
  2066. X#   if BUFSIZ == 512
  2067. X#    define MAX_BLOCKS    1024
  2068. X#   else
  2069. X#    define MAX_BLOCKS    512
  2070. X#   endif
  2071. X#else
  2072. X#   define CH_BITS        0
  2073. X#   define MAX_BLOCKS        4096    /* basically unlimited */
  2074. X#endif /* SMALL */
  2075. X
  2076. X#if BUFSIZ == 512
  2077. X#   define BNO_SHIFT        (9 - CH_BITS)
  2078. X#else
  2079. X#   define BNO_SHIFT        (10 - CH_BITS)
  2080. X#endif
  2081. X
  2082. X/* CH_SIZE is how big each chunk is.  For each 1 the DFree pointer
  2083. X   is incremented we extend the tmp file by CH_SIZE characters.
  2084. X   CH_PBLOCK is the # of chunks per block.  RND_MASK is used to mask
  2085. X   off the lower order bits of the daddr to round down to the beginning
  2086. X   of a block.  OFF_MASK masks off the higher order bits so we can get
  2087. X   at the offset into the disk buffer.
  2088. X
  2089. X   NOTE:  It's pretty important that these numbers be multiples of
  2090. X      2.  Be careful if you change things. */
  2091. X#ifndef MAC
  2092. X#define CH_SIZE            (1 << CH_BITS)
  2093. X#define CH_PBLOCK        (BUFSIZ / CH_SIZE)
  2094. X#define RND_MASK        (CH_PBLOCK - 1)
  2095. X#define OFF_MASK        (BUFSIZ - 1)
  2096. X#define BNO_MASK        (MAX_BLOCKS - 1)
  2097. X#define blk_round(daddr)    (daddr & ~RND_MASK)
  2098. X#define forward_block(daddr)    (daddr + CH_PBLOCK)
  2099. X#define da_to_bno(daddr)    ((daddr >> BNO_SHIFT) & BNO_MASK)
  2100. X#define da_to_off(daddr)    ((daddr << CH_BITS) & OFF_MASK)
  2101. X#define da_too_huge(daddr)    ((daddr >> BNO_SHIFT) >= MAX_BLOCKS)
  2102. X#else
  2103. X#define CH_SIZE            ((disk_line)1 << CH_BITS)
  2104. X#define CH_PBLOCK        ((disk_line)BUFSIZ / CH_SIZE)
  2105. X#define RND_MASK        ((disk_line)CH_PBLOCK - 1)
  2106. X#define OFF_MASK        ((disk_line)BUFSIZ - 1)
  2107. X#define BNO_MASK        ((disk_line)MAX_BLOCKS - 1)
  2108. X#define blk_round(daddr)    ((disk_line)daddr & ~RND_MASK)
  2109. X#define forward_block(daddr)    ((disk_line)daddr + CH_PBLOCK)
  2110. X#define da_to_bno(daddr)    ((disk_line)(daddr >> BNO_SHIFT) & BNO_MASK)
  2111. X#define da_to_off(daddr)    ((disk_line)(daddr << CH_BITS) & OFF_MASK)
  2112. X#define da_too_huge(daddr)    ((disk_line)(daddr >> BNO_SHIFT) >= MAX_BLOCKS)
  2113. X#endif
  2114. END_OF_FILE
  2115. if test 4029 -ne `wc -c <'./temp.h'`; then
  2116.     echo shar: \"'./temp.h'\" unpacked with wrong size!
  2117. fi
  2118. # end of './temp.h'
  2119. fi
  2120. if test -f './termcap.h' -a "${1}" != "-c" ; then 
  2121.   echo shar: Will not clobber existing file \"'./termcap.h'\"
  2122. else
  2123. echo shar: Extracting \"'./termcap.h'\" \(2260 characters\)
  2124. sed "s/^X//" >'./termcap.h' <<'END_OF_FILE'
  2125. X/***************************************************************************
  2126. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  2127. X * is provided to you without charge, and with no warranty.  You may give  *
  2128. X * away copies of JOVE, including sources, provided that this notice is    *
  2129. X * included in all the files.                                              *
  2130. X ***************************************************************************/
  2131. X
  2132. X#define MAXCOLS        256    /* maximum number of columns */
  2133. X
  2134. X#ifndef MAC
  2135. X#ifndef _TERM
  2136. X
  2137. X/* termcap definitions */
  2138. X
  2139. extern char
  2140. X    *UP,    /* Scroll reverse, or up */
  2141. X    *CS,    /* If on vt100 */
  2142. X    *SO,    /* Start standout */
  2143. X    *SE,    /* End standout */
  2144. X    *CM,    /* The cursor motion string */
  2145. X    *CL,    /* Clear screen */
  2146. X    *CE,    /* Clear to end of line */
  2147. X    *HO,    /* Home cursor */
  2148. X    *AL,    /* Addline (insert line) */
  2149. X    *DL,    /* Delete line */
  2150. X    *VS,    /* Visual start */
  2151. X    *VE,    /* Visual end */
  2152. X    *KS,    /* Keypad mode start */
  2153. X    *KE,    /* Keypad mode end */
  2154. X    *TI,    /* Cursor addressing start */
  2155. X    *TE,    /* Cursor addressing end */
  2156. X    *IC,    /* Insert char */
  2157. X    *DC,    /* Delete char */
  2158. X    *IM,    /* Insert mode */
  2159. X    *EI,    /* End insert mode */
  2160. X    *LL,    /* Last line, first column */
  2161. X    *M_IC,    /* Insert char with arg */
  2162. X    *M_DC,    /* Delete char with arg */
  2163. X    *M_AL,    /* Insert line with arg */
  2164. X    *M_DL,    /* Delete line with arg */
  2165. X    *SF,    /* Scroll forward */
  2166. X    *SR,    /* Scroll reverse */
  2167. X    *SP,    /* Send cursor position */
  2168. X    *VB,    /* visible bell */
  2169. X    *BL,    /* audible bell */
  2170. X    *IP,    /* insert pad after character inserted */
  2171. X    *lPC,
  2172. X    *NL;    /* newline character (usually \n) */
  2173. X
  2174. extern int
  2175. X    LI,        /* number of lines */
  2176. X    ILI,        /* number of internal lines */
  2177. X    CO,        /* number of columns */
  2178. X
  2179. X    UL,        /* underscores don't replace chars already on screen */
  2180. X    MI,        /* okay to move while in insert mode */
  2181. X    SG,        /* number of magic cookies left by SO and SE */
  2182. X
  2183. X    TABS,        /* whether we are in tabs mode */
  2184. X    UPlen,        /* length of the UP string */
  2185. X    HOlen,        /* length of Home string */
  2186. X    LLlen;        /* length of lower string */
  2187. X
  2188. extern char
  2189. X    PC,
  2190. X    *BC;        /* back space */
  2191. X
  2192. extern short    ospeed;
  2193. X
  2194. X#endif /* _TERM */
  2195. X
  2196. X#else /* MAC */    
  2197. extern int    /* probably should clean this up */
  2198. X    LI,        /* number of lines */
  2199. X    ILI,        /* number of internal lines */
  2200. X    CO,        /* number of columns */
  2201. X    TABS,
  2202. X    SG;
  2203. X#endif /* MAC */
  2204. END_OF_FILE
  2205. if test 2260 -ne `wc -c <'./termcap.h'`; then
  2206.     echo shar: \"'./termcap.h'\" unpacked with wrong size!
  2207. fi
  2208. # end of './termcap.h'
  2209. fi
  2210. if test -f './tune.dos' -a "${1}" != "-c" ; then 
  2211.   echo shar: Will not clobber existing file \"'./tune.dos'\"
  2212. else
  2213. echo shar: Extracting \"'./tune.dos'\" \(868 characters\)
  2214. sed "s/^X//" >'./tune.dos' <<'END_OF_FILE'
  2215. X/***************************************************************************
  2216. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  2217. X * is provided to you without charge, and with no warranty.  You may give  *
  2218. X * away copies of JOVE, including sources, provided that this notice is    *
  2219. X * included in all the files.                                              *
  2220. X ***************************************************************************/
  2221. X
  2222. X#define NOEXTERNS
  2223. X
  2224. X#include "tune.h"
  2225. X
  2226. X/* these are variables that can be set with the set command, so they are
  2227. X   allocated more memory than they actually need for the defaults */
  2228. char    TmpFilePath[64] = ".",
  2229. X    Shell[64] = "command",
  2230. X    ShFlags[16] = "-c",
  2231. X    CmdDb[64] = "c:/unix/cmds.doc";
  2232. X
  2233. X/* these guys are not settable */
  2234. char    *d_tempfile = "joveXXXXXX",    /* buffer lines go here */
  2235. X    *Joverc = "jove.rc";
  2236. X
  2237. END_OF_FILE
  2238. if test 868 -ne `wc -c <'./tune.dos'`; then
  2239.     echo shar: \"'./tune.dos'\" unpacked with wrong size!
  2240. fi
  2241. # end of './tune.dos'
  2242. fi
  2243. if test -f './tune.template' -a "${1}" != "-c" ; then 
  2244.   echo shar: Will not clobber existing file \"'./tune.template'\"
  2245. else
  2246. echo shar: Extracting \"'./tune.template'\" \(1038 characters\)
  2247. sed "s/^X//" >'./tune.template' <<'END_OF_FILE'
  2248. X/***************************************************************************
  2249. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  2250. X * is provided to you without charge, and with no warranty.  You may give  *
  2251. X * away copies of JOVE, including sources, provided that this notice is    *
  2252. X * included in all the files.                                              *
  2253. X ***************************************************************************/
  2254. X
  2255. X#define NOEXTERNS
  2256. X
  2257. X#include "tune.h"
  2258. X
  2259. char    *d_tempfile = "joveXXXXXX",    /* buffer lines go here */
  2260. X    *p_tempfile = "jrecXXXXXX",    /* line pointers go here */
  2261. X    *Recover = "LIBDIR/recover",
  2262. X    *CmdDb = "LIBDIR/cmds.doc",
  2263. X        /* copy of "cmds.doc" lives in the doc subdirectory */
  2264. X
  2265. X    *Joverc = "LIBDIR/.joverc",
  2266. X
  2267. X#ifdef PIPEPROCS
  2268. X    *Portsrv = "LIBDIR/portsrv",
  2269. X#endif
  2270. X
  2271. X/* these are variables that can be set with the set command, so they are
  2272. X   allocated more memory than they actually need for the defaults */
  2273. X
  2274. X    TmpFilePath[128] = "TMPDIR",
  2275. X    Shell[128] = "SHELL",
  2276. X    ShFlags[16] = "-c";
  2277. END_OF_FILE
  2278. if test 1038 -ne `wc -c <'./tune.template'`; then
  2279.     echo shar: \"'./tune.template'\" unpacked with wrong size!
  2280. fi
  2281. # end of './tune.template'
  2282. fi
  2283. if test -f './version.c' -a "${1}" != "-c" ; then 
  2284.   echo shar: Will not clobber existing file \"'./version.c'\"
  2285. else
  2286. echo shar: Extracting \"'./version.c'\" \(487 characters\)
  2287. sed "s/^X//" >'./version.c' <<'END_OF_FILE'
  2288. X/***************************************************************************
  2289. X * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  2290. X * is provided to you without charge, and with no warranty.  You may give  *
  2291. X * away copies of JOVE, including sources, provided that this notice is    *
  2292. X * included in all the files.                                              *
  2293. X ***************************************************************************/
  2294. X
  2295. char    *version = "4.9";
  2296. END_OF_FILE
  2297. if test 487 -ne `wc -c <'./version.c'`; then
  2298.     echo shar: \"'./version.c'\" unpacked with wrong size!
  2299. fi
  2300. # end of './version.c'
  2301. fi
  2302. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  2303.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  2304. else
  2305. echo shar: Extracting \"'MANIFEST'\" \(2625 characters\)
  2306. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  2307. X   File Name        Archive #    Description
  2308. X-----------------------------------------------------------
  2309. X ./MANIFEST                 1    
  2310. X ./Makefile                 4    
  2311. X ./Makefile.dos             1    
  2312. X ./Ovmakefile               3    
  2313. X ./README                   4    
  2314. X ./Readme.dos               5    
  2315. X ./Readme.mac               8    
  2316. X ./abbrev.c                 3    
  2317. X ./argcount.c               1    
  2318. X ./ask.c                    6    
  2319. X ./buf.c                    6    
  2320. X ./c.c                      7    
  2321. X ./case.c                   1    
  2322. X ./ctype.c                  5    
  2323. X ./ctype.h                  1    
  2324. X ./delete.c                 3    
  2325. X ./disp.c                  13    
  2326. X ./doc/README               1    
  2327. X ./doc/cmds.doc.nr          1    
  2328. X ./doc/example.rc           1    
  2329. X ./doc/jove.1              19    
  2330. X ./doc/jove.2              17    
  2331. X ./doc/jove.3               6    
  2332. X ./doc/jove.4              20    
  2333. X ./doc/jove.5              16    
  2334. X ./doc/jove.nr              5    
  2335. X ./doc/jove.qref            2    
  2336. X ./doc/system.rc            1    
  2337. X ./doc/teach-jove          18    
  2338. X ./doc/teachjove.nr         1    
  2339. X ./extend.c                10    
  2340. X ./externs.h               11    
  2341. X ./fmt.c                    4    
  2342. X ./fp.c                     3    
  2343. X ./funcdefs.c               9    
  2344. X ./getch.c                  1    
  2345. X ./insert.c                 7    
  2346. X ./io.c                    12    
  2347. X ./io.h                     1    
  2348. X ./iproc-pipes.c            3    
  2349. X ./iproc-ptys.c             3    
  2350. X ./iproc.c                  4    
  2351. X ./jove.c                  11    
  2352. X ./jove.h                   8    
  2353. X ./keymaps.txt             15    
  2354. X ./mac.c                   21    
  2355. X ./mac.h                    2    
  2356. X ./macros.c                 3    
  2357. X ./macvert.c                1    
  2358. X ./malloc.c                 2    
  2359. X ./marks.c                  2    
  2360. X ./menumaps.txt             1    
  2361. X ./misc.c                   4    
  2362. X ./mjovers.Hqx              1    
  2363. X ./move.c                   2    
  2364. X ./paragraph.c              6    
  2365. X ./portsrv.c                1    
  2366. X ./proc.c                   9    
  2367. X ./re.c                    10    
  2368. X ./re.h                     1    
  2369. X ./re1.c                    5    
  2370. X ./rec.c                    1    
  2371. X ./rec.h                    1    
  2372. X ./recover.c                7    
  2373. X ./scandir.c                2    
  2374. X ./screen.c                14    
  2375. X ./setmaps.c                2    
  2376. X ./table.c                  1    
  2377. X ./table.h                  1    
  2378. X ./teachjove.c              1    
  2379. X ./temp.h                   1    
  2380. X ./term.c                   2    
  2381. X ./termcap.h                1    
  2382. X ./tune.dos                 1    
  2383. X ./tune.h                   2    
  2384. X ./tune.template            1    
  2385. X ./util.c                   8    
  2386. X ./vars.c                   2    
  2387. X ./version.c                1    
  2388. X ./wind.c                   4    
  2389. X MANIFEST                   1    This shipping list
  2390. END_OF_FILE
  2391. if test 2625 -ne `wc -c <'MANIFEST'`; then
  2392.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  2393. fi
  2394. # end of 'MANIFEST'
  2395. fi
  2396. echo shar: End of archive 1 \(of 21\).
  2397. cp /dev/null ark1isdone
  2398. MISSING=""
  2399. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
  2400.     if test ! -f ark${I}isdone ; then
  2401.     MISSING="${MISSING} ${I}"
  2402.     fi
  2403. done
  2404. if test "${MISSING}" = "" ; then
  2405.     echo You have unpacked all 21 archives.
  2406.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2407. else
  2408.     echo You still need to unpack the following archives:
  2409.     echo "        " ${MISSING}
  2410. fi
  2411. ##  End of shell archive.
  2412. exit 0
  2413.